<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_format</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 28/07/2004</div>
    <p>
      <b>mtlb_format</b> - Matlab format emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Matlab and Scilab <tt>
        <b>format</b>
      </tt> behave differently in some particular cases:</p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        Some Matlab formats do not exist in Scilab
        </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        Calling sequence for <tt>
              <b>format</b>
            </tt> is different in Scilab and Matlab
        </li>
        </dd>
      </dd>
    </dl>
    <p>
    The function <tt>
        <b>mtlb_format(type,prec)</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>format([type prec])</b>
      </tt> when it was not
    possible to know what were the inputs while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_format</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type=""</b>
            </tt> and <tt>
              <b>prec=""</b>
            </tt>
            <tt>
              <b>mtlb_format("","")</b>
            </tt> may be replaced by <tt>
              <b>format("v",6)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="+"</b>
            </tt> and <tt>
              <b>prec=""</b>
            </tt>
            <tt>
              <b>mtlb_format("+","")</b>
            </tt> may be replaced by <tt>
              <b>format(6)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="long"</b>
            </tt> and <tt>
              <b>prec=""</b>
            </tt>
            <tt>
              <b>mtlb_format("long","")</b>
            </tt> may be replaced by <tt>
              <b>format(16)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="long"</b>
            </tt> and <tt>
              <b>prec="e"</b>
            </tt>
            <tt>
              <b>mtlb_format("long","e")</b>
            </tt> may be replaced by <tt>
              <b>format("e"16)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="long"</b>
            </tt> and <tt>
              <b>prec="g"</b>
            </tt>
            <tt>
              <b>mtlb_format("long","g")</b>
            </tt> may be replaced by <tt>
              <b>format("e"16)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="short"</b>
            </tt> and <tt>
              <b>prec=""</b>
            </tt>
            <tt>
              <b>mtlb_format("short","")</b>
            </tt> may be replaced by <tt>
              <b>format(6)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="short"</b>
            </tt> and <tt>
              <b>prec="e"</b>
            </tt>
            <tt>
              <b>mtlb_format("short","e")</b>
            </tt> may be replaced by <tt>
              <b>format("e"6)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>type="short"</b>
            </tt> and <tt>
              <b>prec="g"</b>
            </tt>
            <tt>
              <b>mtlb_format("short","g")</b>
            </tt> may be replaced by <tt>
              <b>format("e"6)</b>
            </tt>
          </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_format</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
